<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>加法计算器插件</title>
</head>

<body>
    <script>
        (function () {
            function Sum() { }
            Sum.prototype.add = function (a, b) {
                return a + b;
            };
            window.Sum = Sum;
        })();
        var sum = new Sum();
        var result = sum.add(5, 7);
        console.log(result);
    </script>
</body>

</html>